feat: Add support for customizing zIndex of the Toasts #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
First of all, thank you for publishing this fantastic package! It has worked great for our use case so far.
This PR adds support for customizing the
zIndexproperty of the toasts so that they can be displayed on top of other components.Motivation
The motivation for this is that our project uses react-native-reanimated-bottom-sheet and we want the ability to display toasts on top of the bottom sheet when it is open. When I tested this, it did not work. However, adding the zIndex property allowed it to work. I would guess there are other scenarios where it would be useful to customize
zIndexas well.This PR keeps zIndex as optional with a default of 1. That way anyone who doesn't need it can ignore it, and anyone who needs the customization has the option.
Testing
I tested this locally in our project and it works as intended. Unfortunately, I am unable to get the project tests to run locally with
yarn test(even on thedevelopbranch with no changes). If you know how I can fix that, please let me know. I'd be happy to run tests locally to make sure this doesn't break anything.If there is anything I can do to improve this PR to ensure it gets merged, please let me know. Thanks again for your work on this package.